package com.wunong.smart.address;

import com.wunong.smart.address.client.service.UserAddressReadService;
import com.wunong.smart.address.client.service.UserAddressWriteService;
import com.wunong.smart.address.service.UserAddressReadServiceImpl;
import com.wunong.smart.address.service.UserAddressWriteServiceImpl;
import com.wunong.smart.address.domain.service.UserAddressDomainService;
import com.wunong.smart.address.domain.service.impl.UserAddressDomainServiceImpl;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author create by zealot.zt
 */
@Configuration
public class UserAddressDomainConfiguration {

    @ConditionalOnMissingBean(UserAddressDomainService.class)
    @Bean
    public UserAddressDomainService userAddressDomainService() {
        return new UserAddressDomainServiceImpl();
    }

    @ConditionalOnMissingBean(UserAddressReadService.class)
    @Bean
    public UserAddressReadService userAddressReadService() {
        return new UserAddressReadServiceImpl();
    }

    @ConditionalOnMissingBean(UserAddressWriteService.class)
    @Bean
    public UserAddressWriteService userAddressWriteService() {
        return new UserAddressWriteServiceImpl();
    }

}
